$ () ->
    $(".get_btn").click (e) ->
    	param =
    		id: $(e.target).parent().parent().children().eq(0).html()
    		name: $(e.target).parent().parent().children().eq(1).children("#name").val()
    		uname: $(e.target).parent().parent().children().eq(2).children("#uname").val()
    		role_id: $(e.target).parent().parent().children().eq(3).children("#role_id").val()

    	$.post "/api/admin/account/update-info", param, (res) ->
    		if res.status.errCode is 0
               alert "修改成功"
            else
               alert res.status.message

    $(".delete_btn").click (e) ->
        param = 
            id: $(e.target).parent().parent().children().eq(0).html()

        $.post "/api/admin/account/delete", param, (res) ->
            if res.status.errCode is 0
                alert "删除成功"
                window.location.reload()
            else
                alert res.status.message